package com.itheima.mapper;

import com.itheima.pojo.Bookshelf;
import org.apache.ibatis.annotations.*;

import java.util.List;

@Mapper
public interface BookShelfMapper {
    @Select("select *from bookshelf ")
    List<Bookshelf> list();

    @Insert("insert into bookshelf(number, address, create_time, update_time)" +
            "values (#{number},#{address},#{createTime},#{updateTime})")
    void add(Bookshelf bookshelf);
    @Update("update bookshelf set number=#{number},address=#{address},update_time=#{updateTime} where id=#{id}")
    void updateShelf(Bookshelf bookshelf);
    @Delete("delete from bookshelf where id=#{id}")
    void deleteShelf(Integer id);

}
